package com.hln.jingwushi.utils

import com.hln.jingwushi.MyApp
import com.gdsz.libbasic.utils.file.SharedPreferencesUtils

class DataCacheUtil {

    companion object {
        const val ACCESS_URL_KEY = "access_url_key"
        const val LAW_ENFORCEMENT_KEY = "law_enforcement_key"
        const val EQUIPMENT_KEY = "equipment_key"
        const val ALCOHOL_KEY = "alcohol_key"
        const val CAR_LOCATION_KEY = "car_location_key"
        const val NAME_KEY = "name_key"
        const val CONTACT_TEL_KEY = "contact_tel_key"
        const val CONTACT_PERSON_KEY = "contact_person_key"


        fun setAccessUrl (url : String) {
            SharedPreferencesUtils.setParam(MyApp.application(),ACCESS_URL_KEY,url)
        }
        fun getAccessUrl () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(),ACCESS_URL_KEY,"https://www.hiklink.cn/tenant/workBench")
                ?.toString()
        }

        fun setLawEnforcementUrl (url : String) {
            SharedPreferencesUtils.setParam(MyApp.application(),LAW_ENFORCEMENT_KEY,url)
        }
        fun getLawEnforcementUrl () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(),LAW_ENFORCEMENT_KEY,"http://192.168.1.101")
                ?.toString()
        }

        fun setEquipmentUrl (url : String) {
            SharedPreferencesUtils.setParam(MyApp.application(),EQUIPMENT_KEY,url)
        }
        fun getEquipmentUrl () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(),EQUIPMENT_KEY,"http://192.168.1.101")
                ?.toString()
        }

        fun setAlcoholUrl (url : String) {
            SharedPreferencesUtils.setParam(MyApp.application(),ALCOHOL_KEY,url)
        }
        fun getAlcoholUrl () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(),ALCOHOL_KEY,"http://9.hlntx.com")
                ?.toString()
        }

        fun setCarLocationUrl (url : String) {
            SharedPreferencesUtils.setParam(MyApp.application(),CAR_LOCATION_KEY,url)
        }
        fun getCarLocationUrl () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(),CAR_LOCATION_KEY,"https://rtls.aibims.com")
                ?.toString()
        }
        fun setName (name : String) {
            SharedPreferencesUtils.setParam(MyApp.application(), NAME_KEY,name)
        }
        fun getName () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(), NAME_KEY,"某某警务室")
                ?.toString()
        }

        fun setContactTel (tel : String) {
            SharedPreferencesUtils.setParam(MyApp.application(), CONTACT_TEL_KEY,tel)
        }
        fun getContactTel () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(), CONTACT_TEL_KEY,"110")
                ?.toString()
        }


        fun setContactPerson (person : String) {
            SharedPreferencesUtils.setParam(MyApp.mApplication, CONTACT_PERSON_KEY,person)
        }
        fun getContactPerson () : String? {
            return SharedPreferencesUtils.getParam(MyApp.application(), CONTACT_PERSON_KEY,"张三")
                ?.toString()
        }

    }


}